From: Florian Müllner Date: Tue, 9 Dec 2025 13:33:38 +0000 (+0100) Subject: swipeTracker: Handle touchpad gestures on actor X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~45 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=006cef5a687814a5560a564811b16e76430291fc;p=gnome-shell.git swipeTracker: Handle touchpad gestures on actor Touchscreen gestures and scrolling are already handled by events on the associated actor rather than the stage. There's no good reason to not do the same for touchpad gestures as well. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8850 Part-of: --- diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js index 7a0703c26..c21d51e65 100644 --- a/js/ui/swipeTracker.js +++ b/js/ui/swipeTracker.js @@ -103,7 +103,7 @@ const TouchpadSwipeGesture = GObject.registerClass({ 'end': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]}, }, }, class TouchpadSwipeGesture extends GObject.Object { - _init(allowedModes) { + _init(actor, allowedModes) { super._init(); this._allowedModes = allowedModes; this._state = TouchpadState.NONE; @@ -113,8 +113,8 @@ const TouchpadSwipeGesture = GObject.registerClass({ schema_id: 'org.gnome.desktop.peripherals.touchpad', }); - global.stage.connectObject( - 'captured-event::touchpad', this._handleEvent.bind(this), this); + actor.connectObject( + 'event::touchpad', this._handleEvent.bind(this), this); } _handleEvent(actor, event) { @@ -405,7 +405,7 @@ export const SwipeTracker = GObject.registerClass({ null); actor.add_action_full(params.name, params.phase, this._panGesture); - this._touchpadGesture = new TouchpadSwipeGesture(allowedModes); + this._touchpadGesture = new TouchpadSwipeGesture(actor, allowedModes); this._touchpadGesture.connect('begin', this._beginTouchpadGesture.bind(this)); this._touchpadGesture.connect('update', this._updateTouchpadGesture.bind(this)); this._touchpadGesture.connect('end', this._endTouchpadGesture.bind(this));